package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Expend;
import cn.wolfcode.crm.mapper.ExpendMapper;
import cn.wolfcode.crm.service.IExpendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExpendServiceImpl implements IExpendService {

    @Autowired
    ExpendMapper mapper;

    public int deleteByPrimaryKey(Long id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Expend record) {
        return mapper.insert(record);
    }

    @Override
    public Expend selectByPrimaryKey(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Expend> selectAll() {
        return mapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(Expend record) {
        return mapper.updateByPrimaryKey(record);
    }

    public List<Expend> selectExpend() {
        List<Expend> expends = mapper.selectExpend();

        return expends;
    }

    public List<Expend> selectExpendPoint(Long parent_id) {
        return mapper.selectExpendPoint(parent_id);
    }

}
